<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>党组织考核信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				rules: {
					upperLimitScore : {
						required:true,
						numb:true
					},
					scoreNumber: {
						required:true,
						numb:true
					},
					sort:{
						required:true,
						num:true
					}
				},
				messages: {
					upperLimitScore: {
						required:"请输入有效的正数" 
					},
					scoreNumber: {
						required:"请输入有效的正数" 
					},
					sort: {
						required:"请输入有效的正整数" 
					}
				},
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			jQuery.validator.addMethod("numb", function(value, element) {       
			    var numb = /^[0-9\.]{1,10}$/;
			    return this.optional(element) || (numb.test(value));       
			}, "请输入正数"); 
			jQuery.validator.addMethod("num", function(value, element) {       
			    var num = /^[1-9]\d*$/;
			    return this.optional(element) || (num.test(value));       
			}, "请输入正数"); 
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
		<a href="${ctx}/partyassessmentinfo/partyAssessmentInfo/form?id=${partyAssessmentInfo.id}">党组织考核信息
		</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="partyAssessmentInfo" 
	action="${ctx}/partyassessment/partyAssessment/savePartyAssessmentInfo" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<input type="hidden" name="partyAssessmentId" id="partyAssessmentId" 
		value="${partyAssessmentInfo.partyAssessmentId}"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">序号：</label>
			<div class="controls">
				<form:input path="sort" htmlEscape="false" maxlength="25" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">积分内容：</label>
			<div class="controls">
				<form:input path="integralContent" htmlEscape="false" maxlength="256" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">分值设定：</label>
			<div class="controls">
			<form:textarea path="remark" htmlEscape="false" rows="4" maxlength="200" class="input-xxlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">积分方式：</label>
			<div class="controls">
				<form:input path="assignModl" htmlEscape="false" maxlength="256" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">上限分数：</label>
			<div class="controls">
				<form:input path="upperLimitScore" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">赋分方式：</label>
			<div class="controls">
				<form:select path="scoreMode" class="input-xlarge required">
					<form:options items="${fns:getDictList('Score_mode')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<%-- <div class="control-group">
			<label class="control-label">次数：</label>
			<div class="controls">
				<form:input path="number" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">类型：</label>
			<div class="controls">
				<form:select path="type" class="input-xlarge ">
					<form:options items="${fns:getDictList('score_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
	<%-- 	<div class="control-group">
			<label class="control-label">周期：</label>
			<div class="controls">
				<form:select path="periodType" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('cycle_value')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">分/次：</label>
			<div class="controls">
				<form:input path="scoreNumber" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">申报方式：</label>
			<div class="controls">
				<form:select path="mode" class="input-xlarge ">
					<form:options items="${fns:getDictList('declare_scoure')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="partyassessment:partyAssessment:edit">
			<input id="btnSubmit" class="btn btn-primary"  type="submit"  value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>